package test5;

//静态内部类

class OuterClass {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;

    //静态内部类
    static class InnerClass{
        public int data4=4;
        private int data5=5;
        public static int data6=6;

        public OuterClass out=new OuterClass();
        public void test(){
            //System.out.println(data1);//不能访问
          //  System.out.println(data2);//不能访问
            System.out.println(out.data1);
            System.out.println(out.data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(data6);
            System.out.println("InnerClass::test()");
        }
    }
}
public class Demo5 {
    public static void main(String[] args) {
        OuterClass.InnerClass innerClass=new OuterClass.InnerClass();
        innerClass.test();
    }

}
